
[%
metamodel http://www.eclipse.org/uml2/2.0.0/UML

import org.acceleo.modules.uml2.services.Uml2Services
import org.acceleo.modules.uml2.services.StringServices
%]




[%script type="Model" name="generate" file="JSPAdmin.jsp"%]
<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="via" uri="http://taam.org/taglib" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title></title>
	</head>
	<body>
	[%for (eAllContents("Class")){%][%if (hasStereotype("Entity")){%]
		<%@page import="org.acceleo.sample.jdbc.Jdbc[%name%]Dao"%>
	[%}%][%}%]
	

<a href="<%= application.getContextPath() %>/index.html">Index</a>

<br/><br/>
Here you can find all the tables created in the database by the acceleo scripts for the entity object from the model.
<br/><br/>

[%for (eAllContents("Class")){%][%if (hasStereotype("Entity")){%]
<br/>	
<table border="1"><tr><td>[%name%]</td></tr>
[%for (attribute){%]
			[%if (association == null) {%]
			<tr><td>[%name%][%if (ownedComment.body.length() > 0){%]([%ownedComment.body%])[%}%] </td><td>[%type%]</td></tr>
			[%}%]
		[%}%]

</table>
<br/><br/>
<%
Jdbc[%name%]Dao jdbc[%name%]=new Jdbc[%name%]Dao();
if (!jdbc[%name%].isTableExist()){%>
table non existante!

<form action="<%= application.getContextPath() %>/[%name.firstLower()%]Control" method="post">
	
	
		<!--<input type="hidden" name="event" value=""/>-->
		Pour creer la table correspondante dans la base de donnee:	
		<table>

		<tr><td><input type="submit" name="action" value="createTable"/></td></tr>
		</table>
		<input type="hidden" name="redirect" value="JSPAdmin">
	</form>
	
<%}
else{
%>	
	<form action="<%= application.getContextPath() %>/[%name.firstLower()%]Control" method="post">
	
	
		<!--<input type="hidden" name="event" value=""/>-->
		Pour supprimer la table correspondante dans la base de donnee:	
		<table>

		<tr><td><input type="submit" name="action" value="deleteTable"/></td></tr>
		</table>
		<input type="hidden" name="redirect" value="JSPAdmin">

	
	</form>
<%}
%>


	[%}%][%}%]
<br/><br/>
<hr/>
This page is generated by the acceleo script org.taam.JSPs.jspAdmin.mt.

</body>